// half-modal
const { BaseBehavior, COMPONENT_OPTIONS } = require('../../mixins/component');

Component({
    behaviors: [BaseBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        // 是否存在关闭按钮
        isHaveClose: {
            type: Boolean,
            value: true,
        },
        // 标题
        title: {
            type: String,
            value: '',
        },
        // 点击蒙层关闭
        maskClosable: {
            type: Boolean,
            value: true,
        },
        // 是否有蒙层
        mask: {
            type: Boolean,
            value: true,
        },
        show: {
            type: Boolean,
            value: false,
        },
    },
    data: {

    },
    methods: {
        close() {
            const { maskClosable } = this.data;
            if (!maskClosable) return;
            this.setData({ show: false, });
            this.triggerEvent('close');
        },
    }
})
